package com.example.calender.persistence;

import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;

import java.util.UUID;


@Entity(tableName = "users",indices = {@Index("username")})
public class User {

    @NonNull
    @PrimaryKey
    @ColumnInfo(name = "username")
    private String mUserName;

    private String password;

    private String secretGuard;

    public User() {
    }

    @Ignore
    public User(@NonNull String userName) {
        mUserName = UUID.randomUUID().toString();
        mUserName = userName;
    }

    public User(@NonNull String mUserName, String password, String secretGuard) {
        this.mUserName = mUserName;
        this.password = password;
        this.secretGuard = secretGuard;
    }

    public String getMUserName() {
        return mUserName;
    }

    public void setMUserName(String mUserName) {
        this.mUserName = mUserName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public String getSecretGuard() {
        return secretGuard;
    }

    public void setSecretGuard(String secretGuard) {
        this.secretGuard = secretGuard;
    }
}
